- new_form = type == 'new' ? true : false
.form.form-horizontal.plan{id: new_form ? 'new_task' : 'edit_task'}
  .field
    = text_field_tag :task_title, nil, class: 'form-control', required: true, placeholder: '任务名称',
                     'v-on:keypress.enter' => new_form ? 'addTask' : "updateTask('edit')"
    = hidden_field_tag :new_task_path, nil, 'v-model' => 'list.path'
  %span.enter-notice
    可按回车(Enter)提交
  .field.add-task-buttons
    %button.btn.btn-sm.btn-default{ :type => "button", 'v-on:click' => new_form ? 'cancelTask' : 'removeEdit' } 取消
    %button.btn.btn-sm.btn-primary{ :type => "button", 'v-on:click' => new_form ? 'addTask' : "updateTask('edit')" }
      = new_form ? '提交' : '更新'